From df9f3fc694f249a242320435386972688f7755a8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 27 Apr 2023 08:25:30 +0200 Subject: [PATCH] filechoosernative: Plug a memory leak Unref all the GVariants. --- gtk/gtkfilechoosernativeportal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c index 254e62fd95..3d73fa6db9 100644 --- a/gtk/gtkfilechoosernativeportal.c +++ b/gtk/gtkfilechoosernativeportal.c @@ -164,6 +164,8 @@ response_cb (GDBusConnection *connection, g_object_unref (filters); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (self), filter_to_select); g_object_unref (filter_to_select); + + g_variant_unref (current_filter); } g_slist_free_full (self->custom_files, g_object_unref); @@ -171,6 +173,9 @@ response_cb (GDBusConnection *connection, for (i = 0; uris[i]; i++) self->custom_files = g_slist_prepend (self->custom_files, g_file_new_for_uri (uris[i])); + g_free (uris); + g_variant_unref (response_data); + switch (portal_response) { case 0: -- 2.30.2